const Router = require('koa-router');
const tool = require("../../tools/tool");
const router = new Router();
const {db, Op, QueryTypes} = require("../../models/db");
//退货商品列表
router.post('/bill/getBackGoods', async ctx => {
    let user = ctx.user
    let tenantId = user.tenantId;
    let data = await db.query(`select a.id,a.price,b.name invName,b.spec,b.unit1 from goods_back a inner join v_goods b on a.invId=b.id and a.tenantId=${tenantId}`, { type: QueryTypes.SELECT });
    return ctx.suc('', data);
})

module.exports = router;